package com.easy.system.service.impl;

import com.easy.system.dao.ContextDao;
import com.easy.system.dao.impl.ContextDaoImpl;
import com.easy.system.service.ContextService;
import com.easy.system.util.KeyValueDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sunguangzhu
 * Date: 13-8-4
 * Time: 下午12:29
 * To change this template use File | Settings | File Templates.
 */
@Service
public class ContextServiceImpl extends ContextDaoImpl implements ContextService {
    @Resource
    private ContextDao contextDao;

    public List<KeyValueDto> getKeyValueDtos(String tableName) throws SQLException {
        String sql = " select * from " + tableName + " order by id ";
        return this.contextDao.getKeyValueDtos(sql);
    }
}
